1. Field of the Invention
The present invention relates generally to 3D graphics and sampling/antialiasing techniques and more particularly to a system and method for efficiently sampling 3D primitives while minimizing the aliasing artifacts that are caused by sampling.
2. Description of Related Art
The problem of aliasing typically occurs when a continuous signal is represented in a discrete form (commonly referred to as sampling). In the context of 3D graphics, a continuous object (such as a polygon) is represented by a collection of discrete points (pixels) on a display screen. If the sampling is not carefully performed, aliasing artifacts may significantly corrupt the rendered scene. Aliasing artifacts include xe2x80x9cjaggiesxe2x80x9d or xe2x80x9cstaircasingxe2x80x9d that normally appear on the edges of the primitives. The staircase effect becomes more prominent in animations, since the staircase effect tends to creep in the animation images.
The process of eliminating aliasing artifacts is broadly referred to as anti-aliasing. One common anti-aliasing mechanism is referred to as A-buffer (anti-aliased, area-averaged, accumulation buffer) in which polygon edge fragments are sampled, and the information about the fragments are stored as linked lists and blended for antialiasing. However, a disadvantage of the A-buffer algorithm is that this algorithm assumes use of an unbounded memory for storing data such as edge fragment information for complex 3D scenes (scenes with high complexity and/or with a large number of primitives). To simplify the memory requirements in the A-buffer algorithm, heuristics may be used. However, the use of heuristics degrades the quality of the output image. A further disadvantage of the A-buffer algorithm is that it does not detect xe2x80x9cZ-edgesxe2x80x9d, thus resulting in color bleeding problems due to improper Z interpolation.
Another method of anti-aliasing involves an architecture which divides each image layer into pixel regions or xe2x80x9cchunksxe2x80x9d, and the geometry is presorted into bins based upon the particular chunk (or chunks) in which the geometry will be rendered. Each chuck is dealt with independently for anti-aliasing. However, the antialasing algorithm used in this architecture is based upon the A-buffer algorithm, and therefore, suffers from the same disadvantages and drawbacks mentioned previously.
A further anti-aliasing method is known as Z3, which maintains a sorted list of edge fragments and blends the fragments in the same manner as the A-buffer algorithm. Although the Z3 algorithm can detect xe2x80x9cZ-edgesxe2x80x9d, it disadvantageously relies on unbounded memory, use of linked lists which require complex logic, and blending of polygon edge fragments to reduce memory usage which degrades the quality of the output image for a complex 3D scene.
Therefore, there is a need for an improved system and method for efficiently sampling 3D primitives while preventing the aliasing artifacts introduced by the sampling process.
The present system and method prevents the occurrence of aliasing at the edges of polygons in 3D graphics scenes. Advantageously, the anti-aliasing of edges may occur in real time, and the system may also detect both polygon xe2x80x9cgeometry edgesxe2x80x9d and xe2x80x9cZ edgesxe2x80x9d that occur due to the interaction of multiple polygons. Relevant edge information may be stored in a limited (or bounded) memory space during anti-aliasing operations, irrespective of the complexity of the 3D scene. Further, the present system and method may permit significant reduction in memory traffic, leading to a reduced latency and increased rendering speed, since super-sampling need be performed only at the edges of primitives. In an embodiment of the present system and method, selective super-sampling of a pixel is deferred until more than one primitive edge is detected to fall in the pixel. The system and method may also prevent the occurrence of aliasing artifacts and permit high quality images to be generated. In another embodiment, the present system and method prevents aliasing at an edge of a primitive by detecting xe2x80x9cgeometry edgesxe2x80x9d of a current primitive, detecting xe2x80x9cZ edgesxe2x80x9d formed by the intersection of the current primitive and a previously rendered primitive, and super-sampling the detected edges.
A super-sampling system for preventing aliasing in 3D data is provided in accordance with various embodiments. In one embodiment, the super-sampling system includes an edge anti-aliasing module configured to selectively super-sample edge portions of a primitive. The super-sampling system also includes two different memory configurations (i.e., a coarse memory and a fine memory). The coarse memory is configured to store information of pixels that are not super-sampled, while the fine memory is configured to store information of pixels that are super-sampled by the edge anti-aliasing module.
The present system and method selectively super-samples the edges generated by individual primitives as well as by the interaction of primitives. Such a selective approach reduces the memory storage requirements and traffic.